package cn.tingting.cilent;

import cn.tingting.domain.LoginUser;
import cn.tingting.util.AjaxResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class TentantCilentHystrixFallbackFactory implements FallbackFactory<TentantCilent> {
    @Override
    public TentantCilent create(Throwable throwable) {
        return new TentantCilent() {
            @Override
            public AjaxResult addOrUpdate(LoginUser loginUser) {
                return AjaxResult.me().setSuccess(false).setMessage("异常");
            }
        };
    }
}
